//
//  JackeZController.m
//  JeckeMasonry
//
//  Created by 周都 on 16/3/29.
//  Copyright © 2016年 周都. All rights reserved.
//

#import "JackeZController.h"
#import "Masonry.h"
@interface JackeZController ()
@property (nonatomic, strong) Class viewClass;
@end

@implementation JackeZController
- (id)initWithTitleName:(NSString *)titleName viewClass:(Class)viewClass {
   self = [super init];
    if (!self) {
        return nil;
        
    }
    
    
    
    self.title = titleName;
    self.viewClass = viewClass;
    
    return self;
    
    
    
    
    
    
}


-(void)loadView {
    
    [super loadView];
    self.view = [self.viewClass new];
    self.view.backgroundColor = [UIColor whiteColor];
    
    
}




#ifdef __IPHONE_7_0
- (UIRectEdge)edgesForExtendedLayout {
    
    return UIRectEdgeNone;
    
}


#endif

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    UISwipeGestureRecognizer *swipe = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(swipBackeController)];
    swipe.direction = UISwipeGestureRecognizerDirectionRight;
    
    [self.view addGestureRecognizer:swipe];
    
    
    // Do any additional setup after loading the view.
}
/**
 *  轻扫返回
 */
- (void)swipBackeController {
    
    [self dismissViewControllerAnimated:YES completion:^{
        
        
        
    }];
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
